% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cces_recode-outcome.R
\name{yesno_to_binary}
\alias{yesno_to_binary}
\title{Translate a Yes/No variable into 1/0}
\usage{
yesno_to_binary(vec, DK_to_NA = TRUE)
}
\arguments{
\item{vec}{A vector of CCES response values, in character}

\item{DK_to_NA}{Whether don't knows should be treated as NA. Defaults to TRUE.}
}
\value{
A vector of integers
}
\description{
Operationalizes outcomes of type yes/no to binary variables. It is internally
given the values to count as a "Yes" by regular expression, e.g. not only "Yes"
but also "Support" and "For"
}
\examples{
 yesno_to_binary(
  c("Yes",
    "No",
    "Support",
    "Oppose",
    "Somewhat support",
    "Somewhat oppose",
    "For this bill",
    "Against this bill",
    "Not sure",
    "Don't Know",
    NA_character_)
)
}
